home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / mint / gcc / gcc261c.zoo / objects / Stream.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-11-18  |  1.8 KB  |  68 lines

  1. /* Interface for GNU Objective C byte stream
  2.    Copyright (C) 1994 Free Software Foundation, Inc.
  3.    
  4.    Written by:  R. Andrew McCallum <mccallum@gnu.ai.mit.edu>
  5.    Date: July 1994
  6.    
  7.    This file is part of the GNU Objective C Class Library.
  8.  
  9.    This library is free software; you can redistribute it and/or
  10.    modify it under the terms of the GNU Library General Public
  11.    License as published by the Free Software Foundation; either
  12.    version 2 of the License, or (at your option) any later version.
  13.    
  14.    This library is distributed in the hope that it will be useful,
  15.    but WITHOUT ANY WARRANTY; without even the implied warranty of
  16.    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  17.    Library General Public License for more details.
  18.    
  19.    You should have received a copy of the GNU Library General Public
  20.    License along with this library; if not, write to the Free
  21.    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  22.    */ 
  23.  
  24. #ifndef __Stream_h__OBJECTS_INCLUDE
  25. #define __Stream_h__OBJECTS_INCLUDE
  26.  
  27. #include <objects/stdobjects.h>
  28.  
  29. /* More modes needed? truncate? create? */
  30. enum 
  31. {
  32.   STREAM_READONLY = 0, 
  33.   STREAM_WRITEONLY, 
  34.   STREAM_READWRITE
  35. };
  36.  
  37. @interface Stream : Object
  38. {
  39.   int mode;
  40. }
  41.  
  42. - initWithMode: (int)m;
  43. - init;
  44.  
  45. - (int) writeByte: (unsigned char)b;
  46. - (int) readByte: (unsigned char*)b;
  47.  
  48. - (int) writeBytes: (const void*)b length: (int)l;
  49. - (int) readBytes: (void*)b length: (int)l;
  50.  
  51. - (int) writeFormat: (const char *)format, ...;
  52. - (int) readFormat: (const char *)format, ...;
  53.  
  54. - (void) writeLine: (const char *)l;
  55. - (char *) readLine;
  56.  
  57. - (void) rewindStream;
  58. - (void) flushStream;
  59. - (void) setStreamPosition: (unsigned)i;
  60. - (unsigned) streamPosition;
  61. - (BOOL) streamEof;
  62. - (int) streamMode;
  63.  
  64. @end
  65.  
  66. #endif /* __Stream_h__OBJECTS_INCLUDE */
  67.  
  68.